package com.onepiece.shipelves.common.vo;
import com.onepiece.shipelves.common.sort.AbstractOldBasePageReq;

/**
 * @author ting
 * @version v1.0
 * @ClassName: BaseQuery
 * @Description: TODO
 * @date 2019-03-27
 */
public class BaseQuery extends AbstractOldBasePageReq {

    private Integer pageNum = 1;

    private Integer pageSize = 15;

    private Boolean pageFlag = false;

    private Integer limitStart;

    private Integer limitEnd;

    public void startPage(){
        if (pageNum == null || pageNum == 0) {
            pageNum = 1;
        }
        if (pageSize == null || pageNum == 0) {
            pageSize = 15;
        }
        pageFlag = true;
        limitStart = (pageNum - 1) * pageSize;
        limitEnd = pageSize;
    }

    public Boolean getPageFlag() {
        return pageFlag;
    }

    public void setPageFlag(Boolean pageFlag) {
        this.pageFlag = pageFlag;
    }

    public Integer getLimitStart() {
        return limitStart;
    }

    public Integer getLimitEnd() {
        return limitEnd;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
